
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
'''
@Project ：图灵学习 
@File    ：10.wait方法在任务外部使用.py
@IDE     ：PyCharm 
@Author  ：ChenLiGao
@Date    ：2024-11-07 20:04
'''
import asyncio

async def work1():
    print("任务1.....")
    await asyncio.sleep(3)

async def work2():
    print("任务2......")
    await asyncio.sleep(2)


loop = asyncio.get_event_loop()
loop.run_until_complete(asyncio.wait([work1(), work2()]))